import base64

a='NASDAQ指数上涨3.45%'
print(base64.b64encode(a.encode()))

def encoded(input):
    table = [
        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
        'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
        'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
        'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
        'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
        'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
        'w', 'x', 'y', 'z', '0', '1', '2', '3',
        '4', '5', '6', '7', '8', '9', '+', '/'
    ]
    a = list(input.encode())
    # print(a)
    b = []
    for i in a:
        if 64<= i < 128 :
            b.append(bin(i).replace('0b', '0'))
        elif i < 64:
            b.append(bin(i).replace('0b', '00'))
        else:
            b.append(bin(i).replace('0b',''))
    # print(b)
    d = []
    for i in b:
        c = list(i)
        for j in c:
            d.append(j)
    # print(d)
    while (len(d) % 6 != 0):
        d.append('0')
    f = []
    i = 0
    while i != len(d):
        e = 0
        j = 0
        while j != 6:
            e *= 10
            e += int(d[i])
            i += 1
            j += 1
        f.append(int('%d' % e, 2))
    g = []
    for i in f:
        g.append(table[int(i)])

    while len(g) % 4 != 0:
        g.append('=')
    h = ''.join(g)
    print(h)

encoded(a)

